package com.cosc716.restaurant.domain.collections;

import java.util.ArrayList;
import java.util.Iterator;

import com.cosc716.restaurant.domain.CustomerGroup;

public class WaitingQueueIterator implements Iterator<CustomerGroup> {

	private ArrayList<CustomerGroup> customers = null;
	private int position = 0;
	
	public WaitingQueueIterator(WaitingQueue customers) {
		this.customers = customers.getCustomers();
	}
	
	@Override
	public boolean hasNext() {
		while(position < customers.size()) {
			return true;
		}
		
		return false;
	}

	@Override
	public CustomerGroup next() {
		return customers.get(position++);
	}

	@Override
	public void remove() {
		customers.remove(position);
	}

}